package com.yc.navy.vote.dao.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.yc.navy.mybatis.util.StringUtil;
import com.yc.navy.vote.Mapper.IUserInfoMapper;
import com.yc.navy.vote.bean.UserInfo;
import com.yc.navy.vote.service.IUserInfoService;

@Service
public class UserInfoServiceImpl implements IUserInfoService {
	@Autowired
	private IUserInfoMapper userInfoMapper;
	
	@Override
	public int reg(UserInfo uf) {
		if(StringUtil.checkNull(uf.getUname(),uf.getPwd())) {
			return -1;
		}
		return userInfoMapper.reg(uf);
	}

	@Override
	public UserInfo login(UserInfo uf) {
		if(StringUtil.checkNull(uf.getUname(),uf.getPwd())) {
			return null;
		}
		return userInfoMapper.login(uf);
	}

}
